﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="dynamicOrderEdit.aspx.cs"
    Inherits="PeisongWeb.admin.dynamicOrderEdit" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>提前下单编辑</title>
    <!--#include file="style.inc"-->

    <script type="text/javascript" language="javascript" src="../app_common/scripts/jquery-1.3.2.js"></script>

    <script type="text/javascript" language="javascript" src="../app_common/scripts/ajaxfileupload.js"></script>

    <script type="text/javascript" src="../app_common/scripts/winClose.js"></script>

    <script type="text/javascript">
        function doConfirm() {
            var msg = "请把缺货或价格波动过大的商品情况告知采购商后再确认！";
            return window.confirm(msg);
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin_main" style="margin: 10px 0 0 10px;">
        <ext:Panel ID="panel_Title" runat="server" Title="商品编辑" BodyStyle="padding:5px 5px 0"
            Width="1200px" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content">
                    <ul>
                        <li>
                            <label>
                                临时订单编号
                            </label>
                            <asp:TextBox runat="server" ID="txt_DynamicOrderId" ReadOnly="true"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                总价格
                            </label>
                            <asp:TextBox runat="server" ID="txt_amount" ReadOnly="true"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                订单状态
                            </label>
                            <asp:TextBox runat="server" ID="txt_status" ReadOnly="true"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                备注
                            </label>
                            <asp:TextBox runat="server" ID="txt_note" Width="150" Height="50" TextMode="MultiLine"></asp:TextBox>
                        </li>
                        <li style="width: 1120px;">
                            <p>
                                &nbsp;</p>
                            <div id="admin_list_content" style="width: 1050px;">
                                <table cellpadding="0" cellspacing="0">
                                    <tr class="header-row">
                                        <th>
                                            商品编号
                                        </th>
                                        <th>
                                            级别
                                        </th>
                                        <th>
                                            商品名称
                                        </th>
                                        <th>
                                            预定数量
                                        </th>
                                        <th>
                                            数量
                                        </th>
                                        <th>
                                            备注
                                        </th>
                                        <th>
                                            预定价格
                                        </th>
                                        <th>
                                            现价
                                        </th>
                                        <th>
                                            总价
                                        </th>
                                        <th>
                                            操作
                                        </th>
                                    </tr>
                                    <asp:Repeater runat="server" ID="rpt_list" OnItemCommand="rpt_list_ItemCommand">
                                        <ItemTemplate>
                                            <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "productNo")%>
                                                </td>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "businessnatureName")%>
                                                </td>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "name")%>
                                                </td>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "initQuantity")%>
                                                    <%#DataBinder.Eval(Container.DataItem, "unit")%>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txt_quantity" MaxLength="10" Width="50" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "quantity")%>'></asp:TextBox>
                                                    /<%#DataBinder.Eval(Container.DataItem, "unit")%>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtNote" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "note")%>'></asp:TextBox>
                                                </td>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "orderprice","{0:F2}")%>
                                                </td>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "nowprice","{0:F2}")%>
                                                </td>
                                                <td>
                                                    <%#DataBinder.Eval(Container.DataItem, "amount","{0:F2}")%>
                                                </td>
                                                <td>
                                                    <span style="<%=isUnderTransfer?"display:block":"display:none" %>" >
                                                    <asp:LinkButton CommandName="Del" OnClientClick="return confirm('你确定要删除吗?');" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"oiid") %>'
                                                        runat="server" ID="lblDel">删除</asp:LinkButton>
                                                    <asp:LinkButton ID="lbt_Remarks" runat="server" CommandName="ReamrksEdit" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"oiid") %>'
                                                        Text="修改">
                                                    </asp:LinkButton>
                                                    </span>
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <tr>
                                        <td colspan="9"></td>
                                        <td><a style="<%=isUnderTransfer?"display:block":"display:none" %>" href="dynamicOrderItemAdd.aspx?orderid=<%= id %>" target="_blank">【添加商品】</a></td>
                                    </tr>
                                </table>
                                <div id="page">
                                    <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                                        OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="50"
                                        InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                                        ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                        CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                                        LastPageText="末页" PrevPageText="上一页">
                                    </webdiyer:AspNetPager>
                                </div>
                            </div>
                        </li>
                        <li>
                            <label>
                                &nbsp;
                            </label>
                            <span>
                                <asp:Button runat="server" ID="btn_Save" Text="生成正式订单" OnClick="btn_Save_Click" OnClientClick="return doConfirm()" />
                            </span>
                            <asp:Button runat="server" ID="btn_Return" Text="&nbsp;返回&nbsp;" OnClick="btn_Return_Click" />
                        </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
    </div>
    <input id="hd_ddl" runat="server" type="hidden" />
    <input id="hd_str" runat="server" type="hidden" value="" />
    <input id="hd_autoAdd" runat="server" type="hidden" />
    <input id="hd_buyers" runat="server" type="hidden" />

    <script type="text/javascript">

        var hdstr = document.getElementById('hd_str').value;
        if (hdstr != "" && hdstr != 0)
            bindPhotoList2(document.getElementById('hd_str').value); 
       
    </script>

    </form>
</body>
</html>
